<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户数据对比</title>
    <script src="../js/echarts.min.js"></script>
    <script src="../js/layui/layui.js"></script>
    <link rel="stylesheet" href="../js/layui/css/layui.css">

</head>
<body>
    <div id="line" style="width: 90%;height:700px;"></div>
    <!--<table class="layui-hide" id="zhiWeiTable" lay-filter="productFilter"></table>-->
</body>
<script>
    var $;
    var table;
    layui.use(['table'], function() {
        $ = layui.jquery;
        table = layui.table;
        $(function () {
            initType();
        })

    })
    //环图
    function initType() {
        // 指定图表的配置项和数据
        $.ajax({
            url: '../zsl/findComZhaoPin',
            type: 'post',
            dataType: 'json',
            data: {},
            success: function (data) {
                var myChart = echarts.init(document.getElementById('line'));
                var option = {
                    tooltip: {
                        trigger: 'item',
                        formatter: "{a} <br/>{b}: {c} ({d}%)"
                    },
                    legend: {
                        orient: 'vertical',
                        x: 'left',
                        data:['全职','兼职','实习']
                    },
                    series: [
                        {
                            name:'握手网',
                            type:'pie',
                            radius: ['50%', '70%'],
                            avoidLabelOverlap: false,
                            label: {
                                normal: {
                                    show: false,
                                    position: 'center'
                                },
                                emphasis: {
                                    show: true,
                                    textStyle: {
                                        fontSize: '30',
                                        fontWeight: 'bold'
                                    }
                                }
                            },
                            labelLine: {
                                normal: {
                                    show: false
                                }
                            },
                            data:[
                                {value:data[0], name:'全职'},
                                {value:data[1], name:'兼职'},
                                {value:data[2], name:'实习'},
                            ]
                        }
                    ]
                };
                myChart.setOption(option);
            }
        })
    }
</script>

</html></html>